package com.security.securityandoauth.controller;

import com.security.securityandoauth.pojo.SysUser;
import com.security.securityandoauth.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("sysUser")
public class SysUserController {

    @Autowired
    private ISysUserService sysUserService;

    @GetMapping("/getSysUserList")
    public List<SysUser> getSysUserList() {
        return sysUserService.list();
    }

    @GetMapping("/addSysUser")
    public String addSysUser(SysUser sysUser) {
        return sysUserService.addSysUser(sysUser) ? "添加成功" : "添加失败";
    }

}
